package com.eeepay.eeepay_v2.adapter;

import android.content.Context;

import com.eeepay.eeepay_v2.R;
import com.eeepay.v2_library.adapter.ABBaseAdapter;
import com.eeepay.v2_library.adapter.ABViewHolder;

import cn.eeepay.api.grpc.nano.ManagementCenterProto;

/**
 * 描述：账号记录的适配器
 * 作者：zhuangzeqin
 * 时间: 2017/5/3-11:52
 * 邮箱：zzq@eeepay.cn
 */
public class SubsidyRecordAdapter extends ABBaseAdapter<ManagementCenterProto.ActivitySubsidiesDetail> {

    public SubsidyRecordAdapter(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_subsidy_record;
    }

    @Override
    public void convert(ABViewHolder holder, ManagementCenterProto.ActivitySubsidiesDetail model) {
        if (model==null) return;
        String balance = String.format("¥%s",model.recordAmount);
        holder.setText(R.id.tv_subsidy_balance,balance);//账号余额
//        //<!-- 类型 credit: 入账; debit: 提现; freeze: 冻结; unfreeze: 解冻-->
        holder.setText(R.id.tv_subsidy_type,model.debitCreditSideZh);
        holder.setText(R.id.tv_subsidy_time,model.recordTime);//时间
        holder.setText(R.id.tv_subsidy_detailed,model.transTypeZh);//活动详情
    }
}
